<?php

use Illuminate\Routing\Router;

Admin::routes();

Route::group([
    'prefix'        => config('admin.route.prefix'),
    'namespace'     => config('admin.route.namespace'),
    'middleware'    => config('admin.route.middleware'),
    'as'            => config('admin.route.prefix') . '.',
], function (Router $router) {

    $router->get('/', 'HomeController@index')->name('home');

    $router->group([
        'prefix'     => 'base',
        'namespace' => 'Base',
    ], function (Router $router){
        $router->resource('/categories', 'CategoryController'); // 分类
        $router->resource('/photos', 'PhotoController'); // 图片
        $router->resource('/tasks', 'TaskController'); // 任务
    });

    $router->group([
        'prefix'     => 'garage',
        'namespace' => 'Garage',
    ], function (Router $router){
        $router->resource('/areas', 'AreaController'); // 区域
        $router->resource('/garages', 'GarageController'); // 仓库
        $router->resource('/account-managers', 'AccountManagerController'); // 客户经理
        $router->resource('/users', 'UserController'); // 用户
        $router->resource('/vehicles', 'VehicleController'); // 汽车
    });

    $router->group([
        'prefix'     => 'operation',
        'namespace' => 'Operation',
    ], function (Router $router){
        $router->resource('/warehouse-entries', 'WarehouseEntryController'); // 入库
        $router->resource('/warehouse-exits', 'WarehouseExitController'); // 出库
        $router->resource('/key-deliveries', 'KeyDeliveryController'); // 寄钥匙
        $router->resource('/key-duplications', 'KeyDuplicationController'); // 配钥匙
        $router->resource('/logistics-inquiries', 'LogisticInquiryController'); // 物流询价
        $router->resource('/item-sendbacks', 'ItemSendBackController'); // 汽车维修
        $router->resource('/vehicle-repairs', 'VehicleRepairController'); // 汽车维修
    });
});
